﻿CREATE TABLE [dbo].[ExecSessionLog] (
    [Id]                        INT              IDENTITY (1, 1) NOT NULL,
    [BlockingSessionId]         INT              NULL,
    [CommandType]               NVARCHAR (255)   NULL,
    [CpuTime]                   INT              NULL,
    [DatabaseName]              NVARCHAR (255)   NULL,
    [ExecutingStatement]        NVARCHAR (MAX)   NULL,
    [HostName]                  NVARCHAR (50)    NULL,
    [LastWrite]                 DATETIME         NULL,
    [LastWaitType]              NVARCHAR (255)   NULL,
    [LoginName]                 NVARCHAR (50)    NULL,
    [ObjectName]                NVARCHAR (255)   NULL,
    [ProgramName]               NVARCHAR (255)   NULL,
    [QueryPlan]                 XML              NULL,
    [Reads]                     INT              NULL,
    [SessionId]                 INT              NULL,
    [SessionLogSetId]           UNIQUEIDENTIFIER NULL,
    [SessionStatus]             NVARCHAR (50)    NULL,
    [InstanceName]              NVARCHAR (255)   NULL,
    [TransactionIsolationLevel] NVARCHAR (255)   NULL,
    [WaitResource]              NVARCHAR (255)   NULL,
    [WaitTime]                  INT              NULL,
    [WaitType]                  NVARCHAR (255)   NULL,
    [Writes]                    INT              NULL,
    [LastModifiedDate]          DATETIME         CONSTRAINT [DF_ExecSessionLog_LastModifiedDate] DEFAULT (getdate()) NULL,
    CONSTRAINT [PK_ExecSessionLog_Id] PRIMARY KEY CLUSTERED ([Id] ASC)
);

